using log4net;
using log4net.Appender;
using log4net.Config;
using log4net.Core;
using log4net.Layout;

namespace JamesKovacs.ReSharper.UnitTestSupport.VstsUnit {
    public static class VstsUnitSetup {
        public static readonly ILog logger = LogManager.GetLogger(typeof(VstsUnitSetup));

        static VstsUnitSetup() {
            // log4net configuration
            OutputDebugStringAppender appender = new OutputDebugStringAppender();
            appender.Layout = new SimpleLayout();
            appender.Threshold = Level.Debug;
            BasicConfigurator.Configure(appender);
            logger.Info("log4net has been configured.");
        }

        public static void Initialize() {
            // The call to initialize is simply to ensure 
            // that the static constructor has been called.
        }
    }
}